<template>
  <div>
    <div>
      <el-table
        :data="tableData"
        stripe
        style="width: 100%">
        <el-table-column
          prop="name"
          label="姓名"
          width="200">
        </el-table-column>
        <el-table-column
          prop="academic"
          label="学院">
        </el-table-column>
        <el-table-column
          prop="health"
          label="健康状态">
        </el-table-column>
        <el-table-column
          prop="statue"
          label="工作状态">
        </el-table-column>
        <el-table-column
          prop="temper"
          label="体温">
        </el-table-column>
        <el-table-column
          prop="home"
          label="是否居家">
        </el-table-column>
      </el-table>
    </div>

    <div>
      <el-dialog title="修改用户名和密码" :visible.sync="dialogFormVisible">
        <el-form :model="form">
          <el-form-item label="用户名" :label-width="formLabelWidth">
            <el-input v-model="form.name" ></el-input>
          </el-form-item>
        </el-form>
        <el-form :model="form">
          <el-form-item label="密码" :label-width="formLabelWidth">
            <el-input v-model="form.password" autocomplete="off"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="dialogFormVisible = false,submitPass()">确 定</el-button>
        </div>
      </el-dialog>
    </div>
  </div>
</template>
<script>
export default {
  name: 'AllUser',
  data () {
    return {
      dialogTableVisible: false,
      dialogFormVisible: false,
      form: {
        name:'',
        password:'',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      formLabelWidth: '120px',
      dialogFormVisible: false,
      tableData: []

    }
  },
  created () {
    this.getAll();
  },
  methods:{
    getAll(){
      const routerParams = this.$route.query.table;
      console.log(routerParams)
      this.tableData=routerParams

    }
  },
  watch: {
// 监测路由变化,只要变化了就调用获取路由参数方法将数据存储本组件即可
    '$route': 'getAll'
  }
}
</script>

<style scoped>

</style>
